package com.jbm.onehome.iface;

import javax.persistence.*;
import com.jbm.core.iface.IAcross;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-03-06.
 */
@Entity
@Table(name = "entrance_guard", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class EntranceGuardEntity extends IAcross
{
	public EntranceGuardEntity()
	{
		super();
	}

	public EntranceGuardEntity(IAcross ia)
	{
		super(ia);
	}

    private static final long serialVersionUID = -1072982018909133707L;
    private int eguardId;
    private String equardCode;
    private String equardName;
    private int giId;
    private String openKey;
    private String type;
    private String status;
    private Timestamp createDate;
    private int createId;
    private Timestamp expireDate;
    private Timestamp closeDate;
    private Integer closeId;

    @Id
    @Column(name = "eguard_id")
    @GeneratedValue
    public int getEguardId() {
        return eguardId;
    }

    public void setEguardId(int eguardId) {
        this.eguardId = eguardId;
    }

    @Basic
    @Column(name = "equard_code")
    public String getEquardCode() {
        return equardCode;
    }

    public void setEquardCode(String equardCode) {
        this.equardCode = equardCode;
    }

    @Basic
    @Column(name = "equard_name")
    public String getEquardName() {
        return equardName;
    }

    public void setEquardName(String equardName) {
        this.equardName = equardName;
    }

    @Basic
    @Column(name = "gi_id")
    public int getGiId() {
        return giId;
    }

    public void setGiId(int giId) {
        this.giId = giId;
    }

    @Basic
    @Column(name = "open_key")
    public String getOpenKey() {
        return openKey;
    }

    public void setOpenKey(String openKey) {
        this.openKey = openKey;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_id")
    public int getCreateId() {
        return createId;
    }

    public void setCreateId(int createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "expire_date")
    public Timestamp getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(Timestamp expireDate) {
        this.expireDate = expireDate;
    }

    @Basic
    @Column(name = "close_date")
    public Timestamp getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Timestamp closeDate) {
        this.closeDate = closeDate;
    }

    @Basic
    @Column(name = "close_id")
    public Integer getCloseId() {
        return closeId;
    }

    public void setCloseId(Integer closeId) {
        this.closeId = closeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        EntranceGuardEntity that = (EntranceGuardEntity) o;

        if (createId != that.createId) return false;
        if (eguardId != that.eguardId) return false;
        if (giId != that.giId) return false;
        if (closeDate != null ? !closeDate.equals(that.closeDate) : that.closeDate != null) return false;
        if (closeId != null ? !closeId.equals(that.closeId) : that.closeId != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (equardCode != null ? !equardCode.equals(that.equardCode) : that.equardCode != null) return false;
        if (equardName != null ? !equardName.equals(that.equardName) : that.equardName != null) return false;
        if (expireDate != null ? !expireDate.equals(that.expireDate) : that.expireDate != null) return false;
        if (openKey != null ? !openKey.equals(that.openKey) : that.openKey != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = eguardId;
        result = 31 * result + (equardCode != null ? equardCode.hashCode() : 0);
        result = 31 * result + (equardName != null ? equardName.hashCode() : 0);
        result = 31 * result + giId;
        result = 31 * result + (openKey != null ? openKey.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + createId;
        result = 31 * result + (expireDate != null ? expireDate.hashCode() : 0);
        result = 31 * result + (closeDate != null ? closeDate.hashCode() : 0);
        result = 31 * result + (closeId != null ? closeId.hashCode() : 0);
        return result;
    }

    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
}
